package sopt.dev.activity;

import sopt.dev.R;
import sopt.dev.data.CityVO;
import sopt.dev.data.ItemVO;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class ExpenseClickedActivity extends Activity {

	private ItemVO item;
	private TextView tvDate;
	private TextView tvName;
	private TextView tvMemo;
	private TextView tvExchange;
	private TextView tvWon;
	private TextView tvAdd;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.expense_clicked_activity);


		tvDate = (TextView) findViewById(R.id.expense_clicked_tv_date);
		tvName = (TextView) findViewById(R.id.expense_clicked_tv_name);
		tvMemo = (TextView) findViewById(R.id.expense_clicked_tv_memo);
		tvExchange = (TextView) findViewById(R.id.expense_clicked_tv_exchange);
		tvWon = (TextView) findViewById(R.id.expense_clicked_tv_won);
		tvAdd = (TextView)findViewById(R.id.expense_clicked_tv_address);
		
		item = getDataFromIntent();
		// intent 로 부터 데이터를 받아들임
		if (item != null) {
			tvDate.setText(item.getDate());
			tvName.setText(item.getName());
			tvAdd.setText(item.getAddress());
			tvMemo.setText(item.getComment());
			tvExchange.setText(String.valueOf(item.getPrice()));
			tvWon.setText("");
			
		}

	}

	private ItemVO getDataFromIntent() {
		Intent i = getIntent();
		return (ItemVO) i.getParcelableExtra("item_data");
	}

}
